package com.zcs.android.app.jetpack.ui.home

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.ViewModelProvider

import com.zcs.android.app.jetpack.R
import com.zcs.android.app.jetpack.ui.home.vm.ContactViewModel
import com.zcs.android.lib.utils.LogUtils
import com.zcs.android.lib.base.BaseFragment

class ContactFragment : BaseFragment() {

    companion object {
        fun newInstance() = ContactFragment()
    }

    private lateinit var viewModel: ContactViewModel
    override fun initUI() {
        LogUtils.d("initUI called in ${javaClass.simpleName}")
    }

    override fun initData() {
        LogUtils.d("initData called in ${javaClass.simpleName}")
    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.contact_fragment, container, false)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        viewModel = ViewModelProvider(this).get(ContactViewModel::class.java)
        LogUtils.d("onActivityCreated called in ${javaClass.simpleName} with viewModel = $viewModel")
        // TODO: Use the ViewModel
        initUI()
        initData()
    }

}
